<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class employment extends ModuleModel {

    /**
     *
     * @var EgresadosService
     */
    private $egresados;

    public function setServices($services) {
        parent::setServices($services);
        $this->egresados = $this->services->Egresados;
    }

    function Create($HistorialLaboral, $ajax = false) {
        return $this->execute("AddInformacionLaboral", $HistorialLaboral, $ajax);
    }

    function Update($HistorialLaboral, $ajax = false) {
        return $this->execute("EditInformacionLaboral", $HistorialLaboral, $ajax);
    }

    function Delete($HistorialLaboralPk, $ajax = false) {
        return $this->execute("DeleteInformacionLaboral", $HistorialLaboralPk, $ajax);
    }

    function GetById($HistorialLaboralPk, $ajax = false) {
        return $this->execute("GetInformacionLaboralById", $HistorialLaboralPk, $ajax);
    }

    function GetByIdentificacion($identificacion, $ajax = false) {
        return $this->execute("GetByIdentificacion", $identificacion, $ajax);
    }

    private function execute($functionName, $param, $ajax) {
        if ($ajax) {
            $this->egresados->setRawMode(true);
            $result = $this->egresados->{$functionName}($param);
            $this->egresados->setRawMode(false);
        }else{
            $result = $this->egresados->{$functionName}($param);
        }

        return $result;
    }

}

?>
